from flask import Flask
from flask import render_template
from flask import request
import json
app = Flask(__name__)

@app.route('/input')
def hello_world():
    return 

@app.route('/test')
def hello_test():
    return 'Hello, test!'

@app.route('/<name>')
def hello_name(name):
    return 'Hello, %s'%name


@app.route('/echarts')
def hello_echarts():
    data_test = {'a':[1,2,3,4,5]}
    return render_template('echarts_model.html',data = data_test)


@app.route('/')
def index():
    # return render_template("hello.html")
    return render_template("login.html")

@app.route('/getData',methods=['POST'])
def getDataForPlot():
    # return render_template("hello.html")
    data1 = request.form.get("name1")
    data2 = request.form.get("name2")
    data3 = request.form.get("name3")
    data4 = request.form.get('name4')
    data = [data1,data2,data3,data4]
    return render_template('echarts_model.html',data_number=json.dumps(data))

if __name__ == '__main__':
    app.run(debug=True)